import 'react-hot-loader/patch';
import React from 'react';
import ReactDOM from 'react-dom';

import { AppContainer } from 'react-hot-loader';
// import Root from './root';
import App from './containers/App';

import { createStore } from 'redux';
import { Provider } from 'react-redux';
import MusicPlayer from './reducer/reducer';

let store = createStore(MusicPlayer)
// console.log(store.getState());

const render = Component => {
  ReactDOM.render(
    <AppContainer>
        <Provider store={store}>
          <Component />
        </Provider>
    </AppContainer>,
    document.querySelector('#root')
  );
}

render(App);

if (module.hot) {
  module.hot.accept('./containers/App', () => { render(App) });
}
